package com.tb.nio;


import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;

/**
 * comment
 *
 * @author zhao yuan
 * @since 2019/1/25
 */
public class NioServer {
    public static void main(String[] args) throws IOException {
        ServerSocketChannel server = ServerSocketChannel.open();
        server.socket().bind(new InetSocketAddress(InetAddress.getByName("127.0.0.1"),19001));
        server.configureBlocking(false);
        Selector selector = Selector.open();
        SelectionKey selectionKey = server.register(selector, SelectionKey.OP_ACCEPT);
        boolean stop = false;
    }

    public static class ReactorTask implements Runnable{
        @Override
        public void run() {

        }
    }
}
